<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
</head>
<body>
<form th:action="@{/doLogin}" th:object="${user}" method="post">
  用户名:<input type="text" id="username" name="username" value="zhangsan" placeholder="请输入用户名"/>
  密码:<input type="password" id="password" name="password" required value="123" minlength="3"/>
  <input type="submit" value="登录"/>
</form>

</body>
<script>
    // function doLogin(){
    //     console.log('dologin>>>')
    //     $.ajax({
    //         url:'/login/process',
    //         type:'POST',
    //         data:{
    //             username:$("#username").val(),
    //             password:$("#password").val()
    //         },
    //         success:function(){
    //             window.location.href='/allUsers'
    //         },
    //         error:function () {
    //             console.log('error')
    //         }
    //     })
    // }
</script>
</html>